﻿using System.Linq;
using EYCmsAdmin.Domain.IDomainServices;
using EYCmsAdmin.Domain.Models;
using EYCmsAdmin.Domain.RepositoryInterfaces;

namespace EYCmsAdmin.Domain.DomainServices
{
    public class UserDomainService : BaseDomainService<User>, IUserDomainService
    {
        public UserDomainService(IBaseRepository<User> repository) : base(repository)
        {
        }

        public User GetUserByLogin(string login)
        {
            return Repository.Query<User>().SingleOrDefault(x => x.Login == login);
        }
    }
}